package com.zyh.utils;
import java.util.Scanner;

public class GetNumber {
    private final Scanner scanner = new Scanner(System.in);

    public int getUserInputAsInt() {
        String input = scanner.nextLine().trim();
        if (input.isEmpty()) return -1;
        try {
            return Integer.parseInt(input);
        } catch (NumberFormatException e) {
            return -1;
        }
    }
}
